(setq gnus-select-method '(nntp "news.cn99.com"))
;(setq gnus-select-method '(nntp "news.bylinux.net"))
;(setq gnus-default-subscribed-newsgroups
;      '("cn.comp.os.linux"
;	"gnu.emacs.help"))

(setq gnus-group-line-format "%P%M%S[%5t]%5y : %(%g%)\n")
(setq gnus-summary-line-format ":%U%R %B %s %-60=|%4L |%-20,20f |%&user-date; \n")
(setq gnus-use-adaptive-scoring t)

;; cache some post 
(setq gnus-use-cache 'passive)

;;save mine post
(setq gnus-message-archive-group
      '((if (message-news-p)
            "nnml:mail.sent.news"
          "nnml:mail.sent.mail")))

(setq gnus-fetch-old-headers t)

;;expire 3 days
(setq nnmail-expiry-wait 3)

(eval-after-load "mm-decode"
  '(progn
     (add-to-list 'mm-discouraged-alternatives "text/html")
     (add-to-list 'mm-discouraged-alternatives "text/richtext")))


(setq user-full-name "ada")
(setq user-mail-address "dazhiqian@gmail.com")

(gnus-add-configuration '(article
                         (vertical 1.0
				   (summary .4 point)
				   (article 1.0))))
(setq gnus-thread-sort-functions
      '(
        (not gnus-thread-sort-by-date)
        (not gnus-thread-sort-by-number)
        ))

;;;zh_CN

(set-language-environment 'Chinese-GB)
(setq gnus-default-charset 'chinese-iso-8bit
gnus-group-name-charset-group-alist '((".*" . chinese-iso-8bit))
gnus-summary-show-article-charset-alist
      '((1 . chinese-iso-8bit)
        (2 . gbk)
        (3 . big5)
        (4 . utf-8))

gnus-newsgroup-ignored-charsets
       '(unknown-8bit x-unknown iso-8859-1))

;;Fetch Email
;; The following line is needed when using pop3.el from T-gnus (m17n.org).
(eval-after-load "mail-source" '(require 'pop3))

;; using GNUS to send mail
(setq message-send-mail-function 'smtpmail-send-it)
(setq send-mail-function 'smtpmail-send-it)

;; use 'one file per mail' back end
(setq gnus-secondary-select-methods '((nnml "")))

;; tell Gnus how to fetch mail
(setq mail-sources '((file :path "/var/mail/ada")
                     (pop  :server "pop.gmail.com"
                           :port 995
                           :user "dazhiqian"
			   :password "***"
                           :connection ssl
                           :leave t))) ; leave the mail on the server

(setq smtpmail-default-smtp-server "smtp.gmail.com")
(setq smtpmail-smtp-server "smtp.gmail.com")
(setq smtpmail-local-domain nil)
(setq smtpmail-debug-info t) ; only to debug problems
(setq smtpmail-auth-credentials '(("smtp.gmail.com" 587 "dazhiqian" "***")))
(setq smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil)))
(setq smtpmail-smtp-service 587)
